home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 April / EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso / EARCD / comm / tcp / AmiSlateMiami.lha / Install_AmiSlate < prev    next >
Text File  |  1996-12-27  |  9KB  |  237 lines

  1. ; Installation script for AmiSlate 1.4
  2. ; by Jeremy Friesner
  3.  
  4. (transcript "On installing AmiSlate 1.4...")
  5.  
  6. ; make sure "rx" is available
  7. (if (not (exists "sys:rexxc/rx"))
  8.     (abort "This installer script needs to use the ARexx utility rx.\n\nPlease make sure the rx utility is installed in sys:rexxc and try to install again."))
  9.  
  10. (if (> (run "assign SlateRexx: EXISTS" (safe)) 0)
  11.     (set DefaultUpdate 0)    
  12.     (set DefaultUpdate 1)
  13. )
  14.  
  15. (set SlateUpdate
  16.       (askchoice
  17.          (prompt "Select which kind of AmiSlate install you want:")
  18.          (choices "First Time Install" "Update")
  19.          (default DefaultUpdate)
  20.          (help "If you've never installed AmiSlate on your system before, select First Time Install.  If you've alread installed an earlier version, select Update.  In an update, no new AmiSlate drawer will be created.")
  21.       )
  22. )
  23.       
  24. (set TestASTwoTwoFiveAssign (run "assign inet: EXISTS" (safe)))
  25. (set TestAmiTCPAssign (run "assign AmiTCP: EXISTS" (safe)))
  26.  
  27. ; default == no net package installed
  28. (set NetworkPackage 3)
  29.  
  30. ; if found inet: assign, change default to AS225 installed
  31. (if (= TestASTwoTwoFiveAssign 0) (set NetworkPackage 1))
  32.  
  33. ; if found AmiTCP: assign, change default to AmiTCP installed
  34. (if (= TestAmiTCPAssign 0)       (set NetworkPackage 0))
  35.  
  36. ; Get the 100% final word from the user, though
  37. (set NetworkPackage
  38.       (askchoice
  39.          (prompt "Please select the network package you have installed.")
  40.          (choices "AmiTCP" "AS225" "Miami" "None")
  41.          (default NetworkPackage)
  42.          (help "AmiSlate is compatible with both AmiTCP and AS225, and can also be run (sans connect ability) without a network package.")
  43.    ))
  44.  
  45. ; determine our root net-package directory from this choice
  46.  
  47. ; default
  48. (set DefDir "")
  49.  
  50. (if (= NetworkPackage 0) 
  51.   (
  52.     (set NetName "AmiTCP")
  53.     (set AmiSlateExecutableName "AmiSlate_AmiTCP")
  54.     (set CheckThisAssign TestAmiTCPAssign)
  55.     (set UserName "root")
  56.     (if (= 0 CheckThisAssign) (set DefDir "AmiTCP:"))
  57.   )
  58. )
  59. (if (= NetworkPackage 1) 
  60.   (
  61.     (set NetName "AS225")
  62.     (set AmiSlateExecutableName "AmiSlate_AS225")
  63.     (set CheckThisAssign TestASTwoTwoFiveAssign)
  64.     (set UserName "")
  65.     (if (= 0 CheckThisAssign) (set DefDir "inet:"))
  66.   )
  67. )
  68.  
  69. (if (= NetworkPackage 2) 
  70.   (
  71.     (set NetName "Miami")
  72.     (set AmiSlateExecutableName "AmiSlate_AmiTCP")
  73.     (set CheckThisAssign 5)
  74.   )
  75. )
  76.  
  77. (if (= NetworkPackage 3) 
  78.   (
  79.     (set NetName "None")
  80.     (set AmiSlateExecutableName "AmiSlate_AmiTCP")
  81.     (set CheckThisAssign 5)
  82.   )
  83. )
  84.  
  85. (if (= SlateUpdate 0)
  86.     (
  87.         ; first time install--ask for directory to create
  88.         (set SlateDir
  89.             (askdir
  90.                 (prompt "Where would you like to install AmiSlate??\n(A drawer named \"AmiSlate\" will be created in the directory you select)")
  91.                 (help @askdir-help)
  92.                 (default DefDir)
  93.             )
  94.         )
  95.         ; make the new directory
  96.         (set NewDir (tackon SlateDir "AmiSlate"))
  97.         (makedir (NewDir) (infos))
  98.     )
  99.     (
  100.         ; update install--ask for directory where current executable is
  101.         (set NewDir
  102.             (askdir
  103.                 (prompt "Where is AmiSlate currently installed??\n(Select the drawer where the old AmiSlate executable is currently located)")
  104.                 (help @askdir-help)
  105.                 (default DefDir)
  106.             )
  107.         )
  108.     )
  109. )
  110.  
  111. (if (= SlateUpdate 0)
  112.     (
  113.         ; direct copy all files but the Install and executables, then assign to the subdir
  114.         (copyfiles
  115.             (prompt (cat "Copying Docs & Scripts to " NewDir))
  116.             (help @copyfiles-help)
  117.             (source "")
  118.             (infos)
  119.             (pattern "~(AmiSlate_AS225#?|AmiSlate_AmiTCP#?|Install#?)")
  120.             (dest NewDir)
  121.         )
  122.         ; now copy the correct executable.
  123.         (copyfiles
  124.             (prompt (cat "Copying executable " AmiSlateExecutableName " to " NewDir))
  125.             (help @copyfiles-help)
  126.             (source "")
  127.             (infos)
  128.             (pattern AmiSlateExecutableName)
  129.             (dest NewDir)
  130.         )
  131.     )
  132.     (
  133.         ; assigns already made, must copy manually
  134.         (copyfiles
  135.             (prompt (cat "Copying " AmiSlateExecutableName ", docs and scripts to " NewDir))
  136.             (help @copyfiles-help)
  137.             (source "")
  138.             (infos)
  139.             (pattern (cat "(" AmiSlateExecutableName "|Doc|ExampleRexx|Readme)"))
  140.             (dest NewDir)
  141.         )
  142.         (copyfiles
  143.             (prompt "Copying ARexx files to SlateRexx:")
  144.             (help @copyfiles-help)
  145.             (source "SlateRexx")
  146.             (files)
  147.             (pattern "#?.(rexx|slatefont)")
  148.             (dest "SlateRexx:")
  149.         )
  150.         (copyfiles
  151.             (prompt "Copying script files to SlateScripts:")
  152.             (help @copyfiles-help)
  153.             (source "SlateScripts")
  154.             (files)
  155.             (pattern "#?")
  156.             (dest "SlateScripts:")
  157.         )
  158.     )
  159. )
  160.  
  161. ; if we haven't been installed before, we need to make the SlateRexx: and SlateScripts: assigns
  162. (if (= SlateUpdate 0)
  163.  (
  164.     (set AssignString1 ("assign SlateRexx: %s/SlateRexx" NewDir ))
  165.     (run AssignString1)
  166.     (set AssignString2 ("assign SlateScripts: %s/SlateScripts\n" NewDir))
  167.     (run AssignString2)
  168.  
  169.     (set AssignString ("assign SlateRexx: %s/SlateRexx\nassign SlateScripts: %s/SlateScripts\n" NewDir NewDir))
  170.     (startup "AmiSlate"
  171.             (prompt "For correct operation, AmiSlate needs two assigns to be present.  These assigns are \n\nSlateRexx: and SlateScripts:\n\n and should be assigned to the installed directories with the same names.  Do you wish me to put the appropriate assigns in your s:user-startup?")
  172.             (help "Sometimes a remote AmiSlate client will request the local one to run an ARexx macro or a AmiSlate recording.  These assigns will be the default directories for these scripts.")
  173.             (command AssignString)
  174.     )
  175.     (run AssignString)
  176.  )
  177. )
  178.  
  179. ; if We have a network package installed...
  180. (if (< NetworkPackage 3)
  181.     ; if the proper assign (AmiTCP: or inet:) is not present...
  182.     (if (> CheckThisAssign 0)
  183.         ; Config Miami instead.
  184.         (
  185.             ; Create the textfile with a pointer to AmiPhoneD
  186.             (textfile
  187.                (dest "t:dbtemp")
  188.                (append
  189.                   "ADD services AmiSlate 2955/tcp\n"
  190.                   ("ADD inetd AmiSlate stream tcp nowait root %s\n" (tackon Newdir "AmiSlate_AmiTCP") )
  191.                )
  192.             )
  193.  
  194.             ; Add the lines to envarc:MiamiChangeDB (i.e. don't overwrite! Other programs
  195.             ; may have their lines there too)
  196.             (run "type t:dbtemp >>envarc:MiamiChangeDB")
  197.  
  198.             ; If Miami shoule be running... why not make it read the new settings?
  199.             (run "SYS:Rexxc/RX \"ADDRESS MIAMI.1;changedb\"")
  200.  
  201.             ; Clean up
  202.             (delete "t:dbtemp")
  203.         )    
  204.         
  205.         ; otherwise put our line into the config files
  206.         (
  207.             ; make sure correct the entry is written in the services file
  208.             (set ARexxRunString (cat "sys:rexxc/rx EditTextFile.rexx " DefDir "db/services AmiSlate AmiSlate^^^^^^^^2955/tcp"))
  209.             (debug ARexxRunString)
  210.             (run
  211.                 (ARexxRunString)
  212.                 (prompt (cat "\nIf you plan to run AmiSlate in conjunction with " NetName ", the line:\n\nAmiSlate      2955/tcp\n\nneeds to be present in your " DefDir "db/services file.  Do you wish me to add it?  (The old services file will be saved to services.bak)"))
  213.                 (help (cat "Including this line in your " DefDir "db/services file tells " NetName "'s inet daemon that all requests on port 2955 should be sent to the AmiSlate program for further processing.  If this line is not included, you will not be able to receive AmiSlate requests from other people.  The ARexx script included with this archive is smart enough to add the line or change an existing line, and the original file will be copied to services.bak before it is updated."))
  214.                 (confirm)
  215.             )
  216.  
  217.             ; make sure correct the entry is written in the inetd.conf file
  218.             (set ExecFile (tackon NewDir AmiSlateExecutableName))
  219.             (set InetDString (cat "AmiSlate stream tcp nowait " UserName " " ExecFile))
  220.             (set InetDPrompt (cat "Also, if you plan run AmiSlate in conjunction with " NetName ", the line:\n\n" InetDString "\n\nneeds to be present in your " DefDir "db/inetd.conf file.  Do you wish me to append/change this line to that file?\n\n(I recommend yes, even if you are only updating from v1.3, as the executable name has changed)"))
  221.             (set InternalInetString (cat "AmiSlate^^^^stream^^^^^^tcp^nowait^" UserName "^^^^" ExecFile))
  222.             (set ARexxRunString (cat "sys:rexxc/rx EditTextFile.rexx " DefDir "db/inetd.conf AmiSlate " InternalInetString))
  223.             (debug ARexxRunString)
  224.             (run
  225.                 (ARexxRunString)    
  226.                 (prompt InetDPrompt)
  227.                 (help (cat "Including this line in your " DefDir "db/inetd.conf file tells " NetName " which program to run whenever it gets an AmiSlate request.  It is important that the file path and name in this line reflect the location of the AmiSlate executable.  The ARexx script included with this archive is smart enough to add the line or change an existing line, and the original file will be copied to inetd.conf.bak before it is updated."))
  228.                 (confirm)
  229.             )
  230.         )
  231.     )
  232. )
  233.  
  234. ; all done
  235. (message "\n\nAmiSlate is now installed.  Reboot your Amiga (just to be certain all assigns are made, etc.) and try it out!")
  236.  
  237.